package com.huanglj.taobaounion.model.api;

import com.huanglj.taobaounion.model.domain.Categories;
import com.huanglj.taobaounion.model.domain.CategoriesById;
import com.huanglj.taobaounion.model.domain.OnSellResult;
import com.huanglj.taobaounion.model.domain.SearchResult;
import com.huanglj.taobaounion.model.domain.SelectedByCategory;
import com.huanglj.taobaounion.model.domain.SelectedPage;
import com.huanglj.taobaounion.model.domain.TicketParams;
import com.huanglj.taobaounion.model.domain.TicketResult;

import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Query;
import retrofit2.http.Url;

public interface Api {

    @GET("discovery/categories")
    Call<Categories> getCategories();

    @GET
    Call<CategoriesById> getCategoriesById(@Url String url);

    @POST("tpwd")
    Call<TicketResult> getTicketCommand(@Body TicketParams params);

    @GET("recommend/categories")
    Call<SelectedPage> getSelectCategories();

    @GET
    Call<SelectedByCategory> getSelectByCategory(@Url String categoryId);

    @GET
    Call<OnSellResult> getSellResult(@Url String page);

    @GET("search")
    Call<SearchResult> getSearchResult(@Query("page") String page,
                                       @Query("keyword") String text);
}
